﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract OsobaPlaca typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OsobaPlacaDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<OsobaPlacaDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.OsobaPlaca _currentOsobaPlaca = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxOsobaPlacaDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxOsobaPlacaErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxOsobaPlacaBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Iznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Neto property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxNetoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Napomena property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNapomenaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOsobaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDPrimanjeTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDPrimanjeTipDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DnevniBrojRadnihSati property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDnevniBrojRadnihSatiDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the SubotaRadna property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxSubotaRadnaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazMjeseci1 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazMjeseci1DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazMjeseci2 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazMjeseci2DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MIO1 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxMIO1DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MIO2 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxMIO2DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazSPovecanimTrajanjemRegos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazSPovecanimTrajanjemRegosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DoprinosNaPlace property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxDoprinosNaPlaceDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Osoba> _IDOsobaList;
		
		/// <summary> 
		/// The list of selectable Osoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Osoba> IDOsobaList
		{
			get {return this._IDOsobaList;}
			set 
			{
				this._IDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DataSource = null;
				this.uxIDOsobaDataGridViewColumn.DataSource = this._IDOsobaList;
			}
		}
		
		private bool _allowNewItemInIDOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Osoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOsobaList
		{
			get { return _allowNewItemInIDOsobaList;}
			set
			{
				this._allowNewItemInIDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.PrimanjeTip> _IDPrimanjeTipList;
		
		/// <summary> 
		/// The list of selectable PrimanjeTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.PrimanjeTip> IDPrimanjeTipList
		{
			get {return this._IDPrimanjeTipList;}
			set 
			{
				this._IDPrimanjeTipList = value;
				this.uxIDPrimanjeTipDataGridViewColumn.DataSource = null;
				this.uxIDPrimanjeTipDataGridViewColumn.DataSource = this._IDPrimanjeTipList;
			}
		}
		
		private bool _allowNewItemInIDPrimanjeTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of PrimanjeTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDPrimanjeTipList
		{
			get { return _allowNewItemInIDPrimanjeTipList;}
			set
			{
				this._allowNewItemInIDPrimanjeTipList = value;
				this.uxIDPrimanjeTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.OsobaPlaca> _OsobaPlacaList;
				
		/// <summary> 
		/// The list of OsobaPlaca to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.OsobaPlaca> OsobaPlacaList
		{
			get {return this._OsobaPlacaList;}
			set
			{
				this._OsobaPlacaList = value;
				this.uxOsobaPlacaBindingSource.DataSource = null;
				this.uxOsobaPlacaBindingSource.DataSource = value;
				this.uxOsobaPlacaDataGridView.DataSource = null;
				this.uxOsobaPlacaDataGridView.DataSource = this.uxOsobaPlacaBindingSource;				
				//this.uxOsobaPlacaBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxOsobaPlacaBindingSource_ListChanged);
				this.uxOsobaPlacaBindingSource.CurrentItemChanged += new System.EventHandler(OnOsobaPlacaBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnOsobaPlacaBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentOsobaPlaca = uxOsobaPlacaBindingSource.Current as Entities.OsobaPlaca;
			
			if (_currentOsobaPlaca != null)
			{
				_currentOsobaPlaca.Validate();
			}
			//_OsobaPlaca.Validate();
			OnCurrentEntityChanged();
		}

		//void uxOsobaPlacaBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.OsobaPlaca"/> instance.
		/// </summary>
		public Entities.OsobaPlaca SelectedOsobaPlaca
		{
			get {return this._currentOsobaPlaca;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxOsobaPlacaDataGridView.VirtualMode;}
			set
			{
				this.uxOsobaPlacaDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxOsobaPlacaDataGridView.AllowUserToAddRows;}
			set {this.uxOsobaPlacaDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxOsobaPlacaDataGridView.AllowUserToDeleteRows;}
			set {this.uxOsobaPlacaDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxOsobaPlacaDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxOsobaPlacaDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="OsobaPlacaDataGridViewBase"/> class.
		/// </summary>
		public OsobaPlacaDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxOsobaPlacaDataGridView = new System.Windows.Forms.DataGridView();
			this.uxOsobaPlacaBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxOsobaPlacaErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNetoDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxDatumOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNapomenaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDPrimanjeTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDnevniBrojRadnihSatiDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxSubotaRadnaDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxStazMjeseci1DataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStazMjeseci2DataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxMIO1DataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxMIO2DataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDoprinosNaPlaceDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			//this.uxIDOsobaBindingSource = new OsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).BeginInit();
			//this.uxIDPrimanjeTipBindingSource = new PrimanjeTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDPrimanjeTipBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPlacaDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPlacaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPlacaErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxOsobaPlacaErrorProvider
			// 
			this.uxOsobaPlacaErrorProvider.ContainerControl = this;
			this.uxOsobaPlacaErrorProvider.DataSource = this.uxOsobaPlacaBindingSource;						
			// 
			// uxOsobaPlacaDataGridView
			// 
			this.uxOsobaPlacaDataGridView.AutoGenerateColumns = false;
			this.uxOsobaPlacaDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxOsobaPlacaDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIznosDataGridViewColumn,
		this.uxNetoDataGridViewColumn,
		this.uxDatumOdDataGridViewColumn,
		this.uxDatumDoDataGridViewColumn,
		this.uxNapomenaDataGridViewColumn,
		this.uxIDOsobaDataGridViewColumn,
		this.uxIDPrimanjeTipDataGridViewColumn,
		this.uxDnevniBrojRadnihSatiDataGridViewColumn,
		this.uxSubotaRadnaDataGridViewColumn,
		this.uxStazMjeseci1DataGridViewColumn,
		this.uxStazMjeseci2DataGridViewColumn,
		this.uxMIO1DataGridViewColumn,
		this.uxMIO2DataGridViewColumn,
		this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn,
		this.uxDoprinosNaPlaceDataGridViewColumn			});
			this.uxOsobaPlacaDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxOsobaPlacaDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxOsobaPlacaDataGridView.Name = "uxOsobaPlacaDataGridView";
			this.uxOsobaPlacaDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxOsobaPlacaDataGridView.TabIndex = 0;	
			this.uxOsobaPlacaDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxOsobaPlacaDataGridView.EnableHeadersVisualStyles = false;
			this.uxOsobaPlacaDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnOsobaPlacaDataGridViewDataError);
			this.uxOsobaPlacaDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaPlacaDataGridViewCellValueNeeded);
			this.uxOsobaPlacaDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaPlacaDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIznosDataGridViewColumn
			//
			this.uxIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosDataGridViewColumn.DataPropertyName = "Iznos";
			this.uxIznosDataGridViewColumn.HeaderText = "Iznos";
			this.uxIznosDataGridViewColumn.Name = "uxIznosDataGridViewColumn";
			this.uxIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosDataGridViewColumn.ReadOnly = false;		
			//
			// uxNetoDataGridViewColumn
			//
			this.uxNetoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNetoDataGridViewColumn.DataPropertyName = "Neto";
			this.uxNetoDataGridViewColumn.HeaderText = "Neto";
			this.uxNetoDataGridViewColumn.Name = "uxNetoDataGridViewColumn";
			this.uxNetoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNetoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNetoDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumOdDataGridViewColumn
			//
			this.uxDatumOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumOdDataGridViewColumn.DataPropertyName = "DatumOd";
			this.uxDatumOdDataGridViewColumn.HeaderText = "DatumOd";
			this.uxDatumOdDataGridViewColumn.Name = "uxDatumOdDataGridViewColumn";
			this.uxDatumOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDoDataGridViewColumn
			//
			this.uxDatumDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDoDataGridViewColumn.DataPropertyName = "DatumDo";
			this.uxDatumDoDataGridViewColumn.HeaderText = "DatumDo";
			this.uxDatumDoDataGridViewColumn.Name = "uxDatumDoDataGridViewColumn";
			this.uxDatumDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxNapomenaDataGridViewColumn
			//
			this.uxNapomenaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNapomenaDataGridViewColumn.DataPropertyName = "Napomena";
			this.uxNapomenaDataGridViewColumn.HeaderText = "Napomena";
			this.uxNapomenaDataGridViewColumn.Name = "uxNapomenaDataGridViewColumn";
			this.uxNapomenaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNapomenaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNapomenaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//
			this.uxIDOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsobaDataGridViewColumn.DataPropertyName = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.HeaderText = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.Name = "uxIDOsobaDataGridViewColumn";
			this.uxIDOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDPrimanjeTipDataGridViewColumn
			//
			this.uxIDPrimanjeTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDPrimanjeTipDataGridViewColumn.DataPropertyName = "IDPrimanjeTip";
			this.uxIDPrimanjeTipDataGridViewColumn.HeaderText = "IDPrimanjeTip";
			this.uxIDPrimanjeTipDataGridViewColumn.Name = "uxIDPrimanjeTipDataGridViewColumn";
			this.uxIDPrimanjeTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDPrimanjeTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDPrimanjeTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxDnevniBrojRadnihSatiDataGridViewColumn
			//
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.DataPropertyName = "DnevniBrojRadnihSati";
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.HeaderText = "DnevniBrojRadnihSati";
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.Name = "uxDnevniBrojRadnihSatiDataGridViewColumn";
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDnevniBrojRadnihSatiDataGridViewColumn.ReadOnly = false;		
			//
			// uxSubotaRadnaDataGridViewColumn
			//
			this.uxSubotaRadnaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSubotaRadnaDataGridViewColumn.DataPropertyName = "SubotaRadna";
			this.uxSubotaRadnaDataGridViewColumn.HeaderText = "SubotaRadna";
			this.uxSubotaRadnaDataGridViewColumn.Name = "uxSubotaRadnaDataGridViewColumn";
			this.uxSubotaRadnaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSubotaRadnaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSubotaRadnaDataGridViewColumn.ReadOnly = false;		
			//
			// uxStazMjeseci1DataGridViewColumn
			//
			this.uxStazMjeseci1DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazMjeseci1DataGridViewColumn.DataPropertyName = "StazMjeseci1";
			this.uxStazMjeseci1DataGridViewColumn.HeaderText = "StazMjeseci1";
			this.uxStazMjeseci1DataGridViewColumn.Name = "uxStazMjeseci1DataGridViewColumn";
			this.uxStazMjeseci1DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazMjeseci1DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazMjeseci1DataGridViewColumn.ReadOnly = false;		
			//
			// uxStazMjeseci2DataGridViewColumn
			//
			this.uxStazMjeseci2DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazMjeseci2DataGridViewColumn.DataPropertyName = "StazMjeseci2";
			this.uxStazMjeseci2DataGridViewColumn.HeaderText = "StazMjeseci2";
			this.uxStazMjeseci2DataGridViewColumn.Name = "uxStazMjeseci2DataGridViewColumn";
			this.uxStazMjeseci2DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazMjeseci2DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazMjeseci2DataGridViewColumn.ReadOnly = false;		
			//
			// uxMIO1DataGridViewColumn
			//
			this.uxMIO1DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMIO1DataGridViewColumn.DataPropertyName = "MIO1";
			this.uxMIO1DataGridViewColumn.HeaderText = "MIO1";
			this.uxMIO1DataGridViewColumn.Name = "uxMIO1DataGridViewColumn";
			this.uxMIO1DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMIO1DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMIO1DataGridViewColumn.ReadOnly = false;		
			//
			// uxMIO2DataGridViewColumn
			//
			this.uxMIO2DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMIO2DataGridViewColumn.DataPropertyName = "MIO2";
			this.uxMIO2DataGridViewColumn.HeaderText = "MIO2";
			this.uxMIO2DataGridViewColumn.Name = "uxMIO2DataGridViewColumn";
			this.uxMIO2DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMIO2DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMIO2DataGridViewColumn.ReadOnly = false;		
			//
			// uxStazSPovecanimTrajanjemRegosDataGridViewColumn
			//
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.DataPropertyName = "StazSPovecanimTrajanjemRegos";
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.HeaderText = "StazSPovecanimTrajanjemRegos";
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.Name = "uxStazSPovecanimTrajanjemRegosDataGridViewColumn";
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.ReadOnly = false;		
			//
			// uxDoprinosNaPlaceDataGridViewColumn
			//
			this.uxDoprinosNaPlaceDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDoprinosNaPlaceDataGridViewColumn.DataPropertyName = "DoprinosNaPlace";
			this.uxDoprinosNaPlaceDataGridViewColumn.HeaderText = "DoprinosNaPlace";
			this.uxDoprinosNaPlaceDataGridViewColumn.Name = "uxDoprinosNaPlaceDataGridViewColumn";
			this.uxDoprinosNaPlaceDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDoprinosNaPlaceDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDoprinosNaPlaceDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//				
			this.uxIDOsobaDataGridViewColumn.DisplayMember = "Ime";	
			this.uxIDOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOsobaDataGridViewColumn.DataSource = uxIDOsobaBindingSource;				
				
			//
			// uxIDPrimanjeTipDataGridViewColumn
			//				
			this.uxIDPrimanjeTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDPrimanjeTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDPrimanjeTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDPrimanjeTipDataGridViewColumn.DataSource = uxIDPrimanjeTipBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxOsobaPlacaDataGridView);
			this.Name = "OsobaPlacaDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDPrimanjeTipBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPlacaErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPlacaDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaPlacaBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				OsobaPlacaDataGridViewEventArgs args = new OsobaPlacaDataGridViewEventArgs();
				args.OsobaPlaca = _currentOsobaPlaca;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class OsobaPlacaDataGridViewEventArgs : System.EventArgs
		{
			private Entities.OsobaPlaca	_OsobaPlaca;
	
			/// <summary>
			/// the  Entities.OsobaPlaca instance.
			/// </summary>
			public Entities.OsobaPlaca OsobaPlaca
			{
				get { return _OsobaPlaca; }
				set { _OsobaPlaca = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxOsobaPlacaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaPlacaDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxOsobaPlacaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaPlacaDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaPlacaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].ID;
						break;
					case "uxIznosDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].Iznos;
						break;
					case "uxNetoDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].Neto;
						break;
					case "uxDatumOdDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].DatumOd;
						break;
					case "uxDatumDoDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].DatumDo;
						break;
					case "uxNapomenaDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].Napomena;
						break;
					case "uxIDOsobaDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].IDOsoba;
						break;
					case "uxIDPrimanjeTipDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].IDPrimanjeTip;
						break;
					case "uxDnevniBrojRadnihSatiDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].DnevniBrojRadnihSati;
						break;
					case "uxSubotaRadnaDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].SubotaRadna;
						break;
					case "uxStazMjeseci1DataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].StazMjeseci1;
						break;
					case "uxStazMjeseci2DataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].StazMjeseci2;
						break;
					case "uxMIO1DataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].MIO1;
						break;
					case "uxMIO2DataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].MIO2;
						break;
					case "uxStazSPovecanimTrajanjemRegosDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].StazSPovecanimTrajanjemRegos;
						break;
					case "uxDoprinosNaPlaceDataGridViewColumn":
						e.Value = OsobaPlacaList[e.RowIndex].DoprinosNaPlace;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxOsobaPlacaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaPlacaDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaPlacaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIznosDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].Iznos = (System.Decimal)e.Value;
						break;
					case "uxNetoDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].Neto = (System.Boolean)e.Value;
						break;
					case "uxDatumOdDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].DatumOd = (System.DateTime)e.Value;
						break;
					case "uxDatumDoDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].DatumDo = (System.DateTime?)e.Value;
						break;
					case "uxNapomenaDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].Napomena = (System.String)e.Value;
						break;
					case "uxIDOsobaDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].IDOsoba = (System.Int32)e.Value;
						break;
					case "uxIDPrimanjeTipDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].IDPrimanjeTip = (System.Int32)e.Value;
						break;
					case "uxDnevniBrojRadnihSatiDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].DnevniBrojRadnihSati = (System.Decimal?)e.Value;
						break;
					case "uxSubotaRadnaDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].SubotaRadna = (System.Boolean)e.Value;
						break;
					case "uxStazMjeseci1DataGridViewColumn":
						OsobaPlacaList[e.RowIndex].StazMjeseci1 = (System.Int32)e.Value;
						break;
					case "uxStazMjeseci2DataGridViewColumn":
						OsobaPlacaList[e.RowIndex].StazMjeseci2 = (System.Int32)e.Value;
						break;
					case "uxMIO1DataGridViewColumn":
						OsobaPlacaList[e.RowIndex].MIO1 = (System.Boolean)e.Value;
						break;
					case "uxMIO2DataGridViewColumn":
						OsobaPlacaList[e.RowIndex].MIO2 = (System.Boolean)e.Value;
						break;
					case "uxStazSPovecanimTrajanjemRegosDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].StazSPovecanimTrajanjemRegos = (System.Int32)e.Value;
						break;
					case "uxDoprinosNaPlaceDataGridViewColumn":
						OsobaPlacaList[e.RowIndex].DoprinosNaPlace = (System.Boolean)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
